package com.jiangruan.javaApiProject.service;

import com.alibaba.fastjson.JSONObject;
import com.jiangruan.javaApiProject.Constants;
import com.jiangruan.javaApiProject.bean.bean.SecondaryPersonCommon;
import com.jiangruan.javaApiProject.net.HttpUtils;

import java.util.List;

/**
 * @Author 默
 * @Date 16:42 2021/12/8
 * @desc
 * @Description
 */
public class SecondaryPersonService {
    public static List<SecondaryPersonCommon> getSecondaryPerson() {
        String url = Constants.TRIP_URL
                + "?key=" + Constants.TRIP_KEY
                + "&type=car_overall"
                + "&size=0";

        String result = HttpUtils.get(url);

        //对二次元达人榜进行JSON
        SecondaryPersonCommon secondaryPersonCommon = JSONObject.parseObject(result, SecondaryPersonCommon.class);

        return secondaryPersonCommon.result;

    }
}
